package practice.p2;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.Socket;


public class FeedBackClient {
    public static void main(String[] args) throws IOException {
        Socket socket=new Socket("localhost",10088);

        OutputStream outputStream = socket.getOutputStream();
        outputStream.write("你好".getBytes());
        //告诉服务端发送结束
        socket.shutdownOutput();

        InputStream inputStream = socket.getInputStream();
        InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
        int s;
            while ((s = inputStreamReader.read()) != -1) {
                System.out.print((char)s);
        }

        socket.close();
    }
}
